/**
 iTextUploader
 (C) 2008 Asgl (myselftdev@gmail.com)
 
 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License
 as published by the Free Software Foundation; version 2
 of the License.
 
 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */

/* Revision: $Id: AlertBox.m 28 2008-09-28 14:16:07Z myselftdev $ */

#import "AlertBox.h"

@implementation AlertBox

- (id)initAlertBox
{
	if(self = [super initWithTitle:@"Working" message:nil delegate:nil cancelButtonTitle:nil otherButtonTitles:nil])
	{
		activityIndicator = [ [UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite];
		[activityIndicator startAnimating];
		[self addSubview:activityIndicator];
	}
	
	return self;
}

-(void)refreshDimensions
{
	self.frame = CGRectMake(self.frame.origin.x, 210.0, self.frame.size.width, 60.0);
	activityIndicator.frame = CGRectMake(60.0, 16.0, activityIndicator.frame.size.width, activityIndicator.frame.size.height);
}

- (void)show
{
	[UIApplication sharedApplication].networkActivityIndicatorVisible = YES;
	[super show];
	[self refreshDimensions];
}

-(void)dismiss
{
	[UIApplication sharedApplication].networkActivityIndicatorVisible = NO;
	[super dismissWithClickedButtonIndex:0 animated:YES];
}

- (void)dealloc
{
	[activityIndicator release];
	
    [super dealloc];
}


@end
